Skip to content

Conversation

@t-b
Copy link
Collaborator

@t-b t-b commented Aug 27, 2025

This is a collaborative work to decruft ipfx. The goal is to make it usable with newer python/numpy/pynwb versions.

The tests without LIMS pass here locally with python 3.9-3.14rc2, numpy 2.32 and pynwb 3.1.2.

PYNWB_NO_CACHE_DIR=1 SKIP_LIMS=true TEST_INHOUSE=false pytest tests

ToDos:

Close #561
Close #567

gouwens and others added 28 commits August 26, 2025 20:54
Fix somes invalid imports introduced in the previous commits.
Also support numpy v1 and v2 with a fallback import.
This probably changed with some python upgrade.
Since numpy 1.18 creating ragged arrays requires explit opt-in via
dtype-object [1].

Let's to that then.

[1]: numpy/numpy#14794
ic_electrodes was renamed to icephys_electrodes and the same for
add_ic_electrode/create_ic_electrode.
Since pynwb 1.1.0 the unit for stimuli are hardcoded, but supplying a
different one gives a warning. So let's just pass in the correct one.

[1]: NeurodataWithoutBorders/pynwb#1186 (comment)
The SweepTable was the first icephys table for grouping different patch
clamp series together, see NeurodataWithoutBorders/pynwb@21f91920 (Add a
SweepTable for icephys data, 2018-11-02) for pynwb 0.6.0.

This was superseeded by the icephys metadata tables introduced in pynwb
2.0.0 and finally removed in 3.0.0.

While migrating to the icephys metadata tables is on the list [1], we
don't want to do this here now.

So let's add a nasty hack for injecting a sweep table.

[1]: AllenInstitute/IPNWB#47
This is removed in python 3.12. And we can also directly use __version__.
… module

This is removed in python 3.12.

We can leverage the importlib.resources module introduced in python 3.9
instead.
…ackage

This is required for the python 3.14 CI job as not all packages ship
wheels.
This is required for the python 3.14-rc on premise job as not all packages
ship wheels.
The on-premise tests were fixed in 078bda8 (Merge pull request #581 from
AllenInstitute/fix-on-premise-tests, 2025-08-26) and also passed on
master [1]. Now they are not passing again with an error like:

credentials = dict((k, os.environ.get(env_var, LIMS_DB_CREDENTIAL_DEFAULTS[env_var]))
        for k, env_var in LIMS_DB_CREDENTIAL_MAP.items())
KeyError: 'LIMS_PASSWORD'

The dict LIMS_DB_CREDENTIAL_DEFAULTS does not contain an entry with
"LIMS_PASSWORD" as key which should be okay as we are always having that
in the envrionment. But this seems to be racy as sometimes we try indexing
LIMS_DB_CREDENTIAL_DEFAULTS with "LIMS_PASSWORD" anyway.

Let's fix that by adding an entry do LIMS_DB_CREDENTIAL_DEFAULTS.

[1]: https://github.com/AllenInstitute/ipfx/actions/runs/17247644153
We don't have feature/XXX branches and this makes it fail.
@t-b t-b self-assigned this Aug 27, 2025
@t-b t-b mentioned this pull request Aug 27, 2025
2 tasks
@t-b t-b mentioned this pull request Aug 27, 2025
2 tasks
@t-b t-b requested a review from gouwens August 27, 2025 11:18
@t-b t-b assigned gouwens and unassigned t-b Aug 27, 2025
@t-b t-b marked this pull request as ready for review August 27, 2025 11:18
@t-b t-b requested a review from gouwens September 5, 2025 19:36
@t-b t-b merged commit ade2213 into master Sep 5, 2025
12 checks passed
@t-b t-b deleted the science-staging-v2 branch September 5, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update supported python versions in setup.py Cannot build on Python 3.12

3 participants